package com.rw.house.controller;


import com.rw.common.entity.OrderInfo;
import com.rw.common.entity.RentInfo;
import com.rw.house.service.RentInfoService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import org.springframework.stereotype.Controller;

/**
 * <p>
 * 租赁合同信息 前端控制器
 * </p>
 *
 * @author Rabit
 * @since 2021-12-20
 */
@RestController
@RequestMapping("/common/rentInfo")
public class RentInfoController {
    Logger logger = LoggerFactory.getLogger(this.getClass());
    @Autowired
    private RentInfoService rentInfoService;

    @GetMapping("{id}")
    public RentInfo getOrderInfoById(@PathVariable("id") Integer id){
        logger.error("RentInfo的getOrderInfoById被调用了==={}",id);
        return rentInfoService.getById(id);
    }

    @PostMapping("save")
    public RentInfo save(@RequestBody RentInfo rentInfo){
        logger.error("RentInfo的save被调用了==={}",rentInfo.toString());
    //    boolean flag = rentInfoService.save(rentInfo);
        boolean flag = true;
        return flag?rentInfo:null;
    }
}

